package cn.com.util;

public class UniqueStringGenerator {

	private UniqueStringGenerator() {
	}

	// 返回唯一编号
	public static synchronized String getUniqueString() {
		if (generateCount > 99999)

			generateCount = 0;

		String uniqueNumber = Long.toString(System.currentTimeMillis())
				+ Integer.toString(generateCount);

		generateCount++;

		return uniqueNumber;

	}

	// 返回六位数字
	public static String getStr() {
		String str = Long.toString(System.currentTimeMillis());
		return str.substring(str.length() - 6);
	}

	@SuppressWarnings("unused")
	private static final int MAX_GENERATE_COUNT = 99999;

	private static int generateCount = 0;

}